import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    age: 10
  },
  modules: {
    menu: {
      state: {
        title: '',
        collapsed: false
      },
      mutations: {
        setTitle (state, data) {
          state.title = data
        },
        setCollapsed (state, data) {
          state.collapsed = !state.collapsed
        }
      }
    }
  }
})

export default store
